/**
*┌──────────────────────────────────────────────────────────────┐
*│　描    述：后台管理员                                                    
*│　作    者：gaotang                                              
*│　版    本：1.0   模板代码自动生成                                              
*│　创建时间：2019-01-04 10:01:02                           
*└──────────────────────────────────────────────────────────────┘
*┌──────────────────────────────────────────────────────────────┐
*│　命名空间： BestTrader.Cms.IServices                                   
*│　接口名称： IManagerRepository                                      
*└──────────────────────────────────────────────────────────────┘
*/
using BestTrader.Cms.Models;
using BestTrader.Cms.ViewModels;
using BestTrader.Cms.ViewModels.WebApi;
using System;
using System.Collections.Generic;
using System.Text;

namespace BestTrader.Cms.IServices
{
    public interface IManagerService
    {
        /// <summary>
        /// 获取 所有相关的用户编号
        /// </summary>
        /// <param name="managerId"></param>
        /// <param name="roleId"></param>
        /// <returns></returns>
        List<ItemsDetailModel> GetSelfAndChildManagerByManagerIdAndRoleId(String managerId, String roleId = "", Boolean isAgent = false);

        /// <summary>
        /// 根据查询条件获取数据
        /// </summary>
        /// <param name="model">查询实体</param>
        /// <returns>table数据</returns>
        TableDataModel LoadData(ManagerRequestModel model, String userId, String roleId);

        /// <summary>
        /// 新增或者修改服务
        /// </summary>
        /// <param name="item">新增或者修改试图实体</param>
        /// <returns>结果实体</returns>
        BaseResult AddOrModify(ManagerAddOrModifyModel model, String userId); 
        /// <summary>
        /// 新增或者修改
        /// </summary>
        /// <param name="model"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        BaseResult AddOrModifyUserInfo(ModifyUserInfoIntput model, String userId);

        /// <summary>
        /// 批量删除
        /// </summary>
        /// <param name="Ids">主键id数组</param>
        /// <returns>结果实体</returns>
        BaseResult DeleteIds(int[] Ids);


        /// <summary>
        /// 批量删除
        /// </summary>
        /// <param name="ManagerId">主键id</param>
        /// <returns>结果实体</returns>
        BaseResult ResetPassword(int ManagerId, String user);

        

        /// <summary>
        /// 修改锁定状态
        /// </summary>
        /// <param name="model">修改锁定状态实体</param>
        /// <returns>结果</returns>
        BaseResult ChangeLockStatus(ChangeStatusModel model);

        /// <summary>
        /// 注册代理
        /// </summary>
        /// <param name="item">新增或者修改注册代理实体</param>
        /// <returns>结果实体</returns>
        BaseResult AddAgent(ManagerAgentRegisterModel model);

        /// <summary>
        /// 直客代理
        /// </summary>
        /// <param name="item">新增或者修改注册直客实体</param>
        /// <returns>结果实体</returns>
        TableDataResult<ManagerLoginModel> AddTerminal(ManagerTerminalRegisterModel model);

        /// <summary>
        /// 审核 注册
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        BaseResult AuditRegister(ManagerAuditRegisterModel model);

        /// <summary>
        /// 登录
        /// </summary>
        TableDataResult<Manager> Login(String userName, String password);

        /// <summary>
        /// 登录操作，成功则写日志
        /// </summary>
        /// <param name="model">登陆实体</param>
        /// <returns>实体对象</returns>
        Manager SignIn(LoginModel model);

        BooleanResult EditPassword(PasswordModel model);

        ManagerListModel GetManagerById(String userId);

        TableDataResult<List<ManagerTreeItem>> GetCacheAllManager(String user, String role);

        /// <summary>
        /// 获取用户list根据userid和权限id
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        TableDataResult<List<ManagerSubItem>> GetCacheSubManagerByUserId(String user, String role);

        /// <summary>
        /// 添加审核备注
        /// </summary>
        /// <param name="Id"></param>
        /// <param name="auditRemark"></param>
        /// <returns></returns>
        BaseResult AddAuditRemark(int Id,string auditRemark);

        /// <summary>
        /// 获取用户状态 0 未审核 1 ok   2 拒绝
        /// </summary>
        /// <param name="UserId"></param>
        /// <returns></returns>
        int? GetManagerStateByManagerId(string UserId);

        TableDataResult<Manager> GetManagerTableById(string ManagerId);
        ///// <summary>
        ///// 获取所有的代理
        ///// </summary>
        //List<ItemsDetailModel> GetCacheAllAgentManager(String user = "", String role = "");

        /// <summary>
        /// 解密用户信息
        /// </summary>
        Manager DecryptManagerInfoById(int managerId);

        /// <summary>
        /// 特殊代理应酬手机号
        /// </summary>
        /// <param name="UID"></param>
        /// <returns></returns>
        Boolean CheckSpecialAgentIsHiddenPhoneByUID(string UID);
    }
}